package com.uni.web.controller.chatai;

import com.uni.common.constant.Constants;
import com.uni.common.core.domain.AjaxResult;
import com.uni.common.core.domain.model.LoginBody;
import com.uni.web.model.ChatEntity;
import com.uni.web.utils.ChatCompletionsUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhangxn
 * @date 2025/4/9  22:26
 */
@Api(tags = {"取名"})
@RestController
public class ChatAiController {

    @ApiOperation(value = "取名", notes = "取名")
    @PostMapping("/chat-ai")
    public AjaxResult login(@RequestBody ChatEntity chatEntity) {
        String message = ChatCompletionsUtils.chatMessage(chatEntity);
        return AjaxResult.success(message);
    }
}
